import { NgModule, Optional, SkipSelf } from '@angular/core';
import { ShareModule } from '@share/share.module';
import { PagesModule } from '@pages/pages.module';
import { ServicesModule } from '@services/services.module';
import { AppRoutingModule } from '../app-routing.module';
import { AppStoreModule } from '@store/index';
import { HttpClientModule } from '@angular/common/http';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';


@NgModule({
  declarations: [],
  imports: [
    PagesModule,
    ShareModule,
    ServicesModule,
    AppRoutingModule,
    AppStoreModule,
    HttpClientModule,
    BrowserModule,
    BrowserAnimationsModule
  ],
  exports: [
    ShareModule,
    AppRoutingModule
  ]
})
export class CoreModule {
  constructor(@SkipSelf() @Optional() parentModule: CoreModule) {
    if (parentModule) {
      throw new Error('CoreModule只能被AppModule引入');
    }
  }
}
